-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Data flow: Add various debug predicates #20614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ee3f6e0
to
f71cfac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds debug predicates to the data flow analysis module to identify nodes with high utility. The changes introduce debugging capabilities that expose statistics and metrics about data flow nodes, including fan-out, fan-in, and path node counts for analysis purposes.
Key changes:
- Introduces a new
Debug
module within the stage logic containing various debugging predicates - Adds predicates to identify maximum fan-out, fan-in, and path node counts
- Exposes these debug predicates through public interfaces for each stage
*/ | ||
additional module Graph { | ||
private newtype TPathNode = | ||
newtype TPathNode = |
Copilot
AI
Oct 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Changing the visibility of TPathNode
from private
to public may expose internal implementation details. Consider if this change is necessary for the debug functionality or if the debug predicates can work with the existing private type.
newtype TPathNode = | |
private newtype TPathNode = |
Copilot uses AI. Check for mistakes.
private int fanOut(PathNodeImpl n) { | ||
result = strictcount(n.getASuccessorImpl(_)) and | ||
not n.isArbitrarySource() | ||
} |
Copilot
AI
Oct 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The fanOut
predicate lacks documentation explaining why arbitrary sources are excluded from the count. Consider adding a comment to clarify this design decision.
Copilot uses AI. Check for mistakes.
private int fanIn(PathNodeImpl n) { | ||
result = strictcount(PathNodeImpl pred | n = pred.getASuccessorImpl(_)) and | ||
not n.isArbitrarySink() | ||
} |
Copilot
AI
Oct 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The fanIn
predicate lacks documentation explaining why arbitrary sinks are excluded from the count. Consider adding a comment to clarify this design decision.
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Adds debug predicates for identifying data flow nodes with high utility. I used these predicates in #20627.